import QtQuick 2.15
import QtQuick.Window 2.15
import QtQuick.Controls 2.15
import QtQuick.Controls 1.4 as Ctrl1

ApplicationWindow {
    id: window
    width: 640
    height: 480
    visible: true

    menuBar: MenuBar {
        Menu {
            //&表示会有一个小的下划线
            title: qsTr("&File")
            Action { text: qsTr("&New...") }
            Action { text: qsTr("&Open...") }
            Action { text: qsTr("&Save") }
            Action { text: qsTr("Save &As...") }
            MenuSeparator { }
            Action {
                text: qsTr("&Quit")
                onTriggered: {
                    close()
                }
            }
        }
        Menu {
            title: qsTr("&Edit")
            Action { text: qsTr("Cu&t") }
            Action { text: qsTr("&Copy") }
            Action { text: qsTr("&Paste") }
        }
        Menu {
            title: qsTr("&Help")
            Action { text: qsTr("&About") }
        }
    }

    Rectangle {
        anchors.fill: parent
        color: 'red'
    }

    header: ToolBar {
        Row {
            ToolButton {
                text: "打开"
            }
        }
        background: Rectangle {
            color: 'orange'
        }
    }

    //footer: ToolBar {
    footer: Ctrl1.StatusBar {
        Row {
            Label {
                text: 'Menu ' + ApplicationWindow.menuBar.count + ' Count'
                font.italic: true
                color: 'DeepSkyBlue'
            }

        }
    }
}
